package com.pangzhao.prize.commons.db.mapper;

import com.pangzhao.prize.commons.db.entity.ZcurdHeadJs;
import com.pangzhao.prize.commons.db.entity.ZcurdHeadJsExample;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcurdHeadJsMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    long countByExample(ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    int deleteByExample(ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    @Delete({
        "delete from zcurd_head_js",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    @Insert({
        "insert into zcurd_head_js (head_id, page, ",
        "sql_content, create_time, ",
        "js_content)",
        "values (#{headId,jdbcType=INTEGER}, #{page,jdbcType=VARCHAR}, ",
        "#{sqlContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{jsContent,jdbcType=LONGVARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ZcurdHeadJs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    int insertSelective(ZcurdHeadJs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    List<ZcurdHeadJs> selectByExampleWithBLOBs(ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    List<ZcurdHeadJs> selectByExample(ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, head_id, page, sql_content, create_time, js_content",
        "from zcurd_head_js",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.pangzhao.prize.commons.db.mapper.ZcurdHeadJsMapper.ResultMapWithBLOBs")
    ZcurdHeadJs selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") ZcurdHeadJs record, @Param("example") ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    int updateByExampleWithBLOBs(@Param("record") ZcurdHeadJs record, @Param("example") ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") ZcurdHeadJs record, @Param("example") ZcurdHeadJsExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(ZcurdHeadJs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    @Update({
        "update zcurd_head_js",
        "set head_id = #{headId,jdbcType=INTEGER},",
          "page = #{page,jdbcType=VARCHAR},",
          "sql_content = #{sqlContent,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "js_content = #{jsContent,jdbcType=LONGVARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(ZcurdHeadJs record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zcurd_head_js
     *
     * @mbg.generated
     */
    @Update({
        "update zcurd_head_js",
        "set head_id = #{headId,jdbcType=INTEGER},",
          "page = #{page,jdbcType=VARCHAR},",
          "sql_content = #{sqlContent,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcurdHeadJs record);
}